package com.design.pattern.factory;

import com.design.pattern.factory.service.Shape;
import com.design.pattern.factory.service.impl.Circle;
import com.design.pattern.factory.service.impl.Rectangle;
import com.design.pattern.factory.service.impl.Square;

public class ShapeFactory0 {

    public Shape getShap(String shapeType){

        if(shapeType == null){

            return null;

        }
        if(shapeType.equalsIgnoreCase("CIRCLE")){

            return new Circle();

        }else if(shapeType.equalsIgnoreCase("RECTANGLE")){

            return new Rectangle();

        }else if(shapeType.equalsIgnoreCase("SQUARE")){

            return new Square();

        }

        return null;

    }

}
